<?php

/**
 * LogTransaction filter form base class.
 *
 * @package    erpcrm
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseLogTransactionFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'entry_date'          => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'transaction_type'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'transaction_subtype' => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'iden1'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'type1'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'iden2'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'type2'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'iden3'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'type3'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'iden4'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'type4'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'debit'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'credit'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'document_iden'       => new sfWidgetFormPropelChoice(array('model' => 'Document', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'entry_date'          => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'transaction_type'    => new sfValidatorPass(array('required' => false)),
      'transaction_subtype' => new sfValidatorPass(array('required' => false)),
      'iden1'               => new sfValidatorPass(array('required' => false)),
      'type1'               => new sfValidatorPass(array('required' => false)),
      'iden2'               => new sfValidatorPass(array('required' => false)),
      'type2'               => new sfValidatorPass(array('required' => false)),
      'iden3'               => new sfValidatorPass(array('required' => false)),
      'type3'               => new sfValidatorPass(array('required' => false)),
      'iden4'               => new sfValidatorPass(array('required' => false)),
      'type4'               => new sfValidatorPass(array('required' => false)),
      'debit'               => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'credit'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'document_iden'       => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Document', 'column' => 'document_iden')),
    ));

    $this->widgetSchema->setNameFormat('log_transaction_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'LogTransaction';
  }

  public function getFields()
  {
    return array(
      'transaction_iden'    => 'Text',
      'entry_date'          => 'Date',
      'transaction_type'    => 'Text',
      'transaction_subtype' => 'Text',
      'iden1'               => 'Text',
      'type1'               => 'Text',
      'iden2'               => 'Text',
      'type2'               => 'Text',
      'iden3'               => 'Text',
      'type3'               => 'Text',
      'iden4'               => 'Text',
      'type4'               => 'Text',
      'debit'               => 'Number',
      'credit'              => 'Number',
      'document_iden'       => 'ForeignKey',
    );
  }
}
